function rgb(r, g, b) {
    let arr = Array.prototype.map.call(arguments,x=>{
        if(x<0) x=0
        if(x>255) x=255
        return x    
    })
    return arr.map(x=>x.toString(16).padStart(2,0).toUpperCase()).join("")
    // return (Math.max(r,0).toString(16).padStart(2,0)+Math.max(g,0).toString(16).padStart(2,0)+Math.max(b,0).toString(16).padStart(2,0)).toUpperCase()
}
console.log(rgb(0,0,-20))